package org.example.service;

import org.springframework.stereotype.Service;

@Service  // 标记为Spring服务组件
public class OrderServiceImpl implements OrderService {

    @Override
    public void add(String pname, int number) {
        System.out.println("模拟添加商品: " + pname + ", 数量: " + number);
    }

    @Override
    public void delete(String pname) {
        System.out.println("模拟删除商品: " + pname);
    }

    @Override
    public int find(String pname) {
        int mockCount = 8;  // 模拟查询结果
        System.out.println("模拟查询商品: " + pname + ", 数量: " + mockCount);
        return mockCount;
    }
}
